<template>
	<view class="page">
		
			<view class="card">
				<view class="u-padding-20 u-flex">
					<view>
						<u-image shape="circle" :src="technician.avatar" width="120" height="120"></u-image>
					</view>
					<view  style="width: 550rpx;" class="u-margin-left-20">
						<view class=" u-flex u-row-between" >
						  <view class="u-flex">
							  <view style="color: #00C08D;font-weight: bold;font-size: 34rpx;">{{technician.nickname}}</view>
							  <view class="u-margin-left-20 u-margin-right-20">
								<u-image src="/static/woman.png" width="30" height="30"></u-image>
							  </view>
							  
							  <u-tag type="success" size="mini" text="已认证"></u-tag>
						  </view>
							
						</view>
						
						<view style="color: #00C08D;font-size: 26rpx;">
							远距离需额外收费
							
						</view>
					</view>
					
				</view>
				<u-cell-item :title-style="{color:'#00C08D',fontWeight:'bolder'}" title="我的服务" :arrow="false" :border-bottom="false"></u-cell-item>
				<view class="u-flex  u-flex-wrap" style="padding:0 30rpx 10rpx 20rpx;">
					<view v-for="(item,index) in technician.project_ids_arr" :key="index" class="u-margin-top-10 u-margin-right-20">
						<u-tag  bg-color="#fff" plain type='info '  :text="item.name"></u-tag>
					</view>
				</view>
				<u-cell-item :title-style="{color:'#00C08D',fontWeight:'bolder'}" title="年龄" :value="technician.age+'岁'" :arrow="false" :border-bottom="false"></u-cell-item>
				<u-cell-item :title-style="{color:'#00C08D',fontWeight:'bolder'}" title="手机号" :value="technician.mobile" :arrow="false" :border-bottom="false"></u-cell-item>
				<u-cell-item :title-style="{color:'#00C08D',fontWeight:'bolder'}" title="浏览量" :value="technician.view_number+'次'" :arrow="false" :border-bottom="false"></u-cell-item>
				<u-cell-item :title-style="{color:'#00C08D',fontWeight:'bolder'}" title="已服务" :value="technician.service_number+'单'" :arrow="false" :border-bottom="false"></u-cell-item>
	
			</view>
			
			
			<view class="bottomFix">
				<u-button @click="care" :type="is_collect?'error':'success'"  shape="circle" > {{is_collect?'取消关注':'关注'}} </u-button>
			</view>
	
	
		
		
	</view>
	
	
	
</template>

<script>
	
	import loader from '@/common/loadPage.js';
	
	
     export default {
		
		data(){
			return{
				id:'',
				technician:{},
				project: [],
				is_collect:0
		
			}
		},
		onLoad(options) {
			if(options.id){
				this.id=options.id;
			}
			this.jiazai()
		
		},
		methods:{
			goEvaluate(){
				uni.navigateTo({
					url:'../evaluate/list?Tid='+this.technician.id
				})
			},
			jiazai(){
				this.$u.post('/technician/details', {
					id:this.id
				}).then(res => {
					this.technician = res.technician;
					
					this.is_collect=res.is_collect;
					
					uni.setNavigationBarTitle({
						title:res.technician.nickname
					})
				}).catch(err => {})
			},
			care(){
				this.$u.post('/technician/setCollect', {
					technician_id:this.id
				}).then(res => {
					this.jiazai()
				}).catch(err => {})
			},
			
		}
	}
</script>

<style>
.u-cell{
	padding:7rpx 15rpx!important;
}
	.card{
		background: #fff;
		margin: auto;

	}
	.project{
		background: #fff;
		box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.1);
		width: 680rpx;
		margin: 20rpx auto;
		padding: 20rpx;
		border-radius: 10rpx;
		display: flex;
		
	}
</style>
